#define _CRT_SECURE_NO_WARNINGS 1
#include<vector>
using namespace std;

class Solution {
public:
    int numIdenticalPairs(vector<int>& nums)
    {
        int ret = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            for (int j = i + 1; j < nums.size(); j++)
            {
                if (nums[i] == nums[j])
                    ret++;
            }
        }
        return ret;
    }
};